package com.bitin.adorn.modules.user.request;

import com.bitin.adorn.common.enumeration.Gender;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

/**
 * @author Mr.Lu
 * @since 2024/12/6 15:19
 */
@Data
@Schema(title = "用户构建请求")
public class UserRegisterRequest {
    @NotBlank
    @Size(min=2, max=30)
    @Schema(title = "用户名", defaultValue = "张三")
    private String username;

    @NotBlank
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入正确手机号手机号")
    @Schema(title = "手机号", defaultValue = "18922206218")
    private String mobile;

    @Email(message = "电子邮箱格式不对")
    @Schema(title = "电子邮箱", defaultValue = "luguanhua110@163.com")
    private String email;

    @NotBlank
    @Size(min=2, max=30)
    @Schema(title = "用户名", defaultValue = "123456")
    private String password;

    @NotNull
    @Min(value = 18, message = "只限于年满18岁使用")
    @Schema(title = "年龄", defaultValue = "18")
    private Integer age;

    @NotNull
    private Gender gender;
}
